package com.ljf.config.dto.command;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ljf.common.validation.AddGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 发号器配置表头--新增修改  config_base_impulse_sender_header
 *
 * @author LJF
 * @since 2025-01-09
 */
@Data
@ApiModel("发号器配置表头--新增修改")
public class ConfigBaseImpulseSenderHeaderCommand implements Serializable {

    @JsonProperty("belongServiceCode")
    @ApiModelProperty(value = "归属服务编码")
    @NotNull(message = "归属服务不能为空", groups = AddGroup.class)
    private Integer belongServiceCode;

    @JsonIgnore
    @ApiModelProperty(value = "归属服务")
    private String belongService;

    @JsonProperty("code")
    @ApiModelProperty(value = "编码")
    @Length(message = "编码不能超过50个字符", max = 50)
    @NotEmpty(message = "编码不能为空", groups = AddGroup.class)
    private String code;

    @JsonProperty("name")
    @ApiModelProperty(value = "名称")
    @Length(message = "名称不能超过20个字符", max = 20)
    @NotEmpty(message = "名称不能为空", groups = AddGroup.class)
    private String name;

    @JsonProperty("refreshMode")
    @ApiModelProperty(value = "刷新模式")
    @NotNull(message = "刷新模式不能为空", groups = AddGroup.class)
    private Integer refreshMode;

    @Valid
    @JsonProperty("detailList")
    @ApiModelProperty(value = "发号明细")
    @NotNull(message = "发号明细不能为空", groups = AddGroup.class)
    private List<ConfigBaseImpulseSenderDetailCommand> detailList;

}
